package cuongnh.project.japanesediary.vocabulary.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="tbl_part_of_speech")
public class PartOfSpeech {

	@Id
	@Column(name = "part_of_speech_id")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="part_of_speech_seq")
	@SequenceGenerator(
			name="part_of_speech_seq",
			sequenceName="part_of_speech_sequence",
			allocationSize=1
		)
	private Short partOfSpeechId;
	
	@Column(name="abbreviated_form", length=10)
	private String abbreviatedForm;
	
	@Column(name="name_english", length=50)
	private String enName;
	
	@Column(name="name_vietnamese", length=50)
	private String vnName;
	
	@Column(name="name_japanese", length=50)
	private String jpName;
	
	@Column(name="description", length=300)
	private String description;
	
	@ManyToMany(mappedBy="partOfSpeechs")    
	private Set<Vocabulary> vocabularies = new HashSet<Vocabulary>();
	
	@Column(name = "created_date")
	private Date createdDate;

	@Column(name = "modified_date")
	private Date modifiedDate;

	public short getPartOfSpeechId() {
		return partOfSpeechId;
	}

	public void setPartOfSpeechId(short partOfSpeechId) {
		this.partOfSpeechId = partOfSpeechId;
	}

	public String getAbbreviatedForm() {
		return abbreviatedForm;
	}

	public void setAbbreviatedForm(String abbreviatedForm) {
		this.abbreviatedForm = abbreviatedForm;
	}

	public String getEnName() {
		return enName;
	}

	public void setEnName(String enName) {
		this.enName = enName;
	}

	public String getVnName() {
		return vnName;
	}

	public void setVnName(String vnName) {
		this.vnName = vnName;
	}

	public String getJpName() {
		return jpName;
	}

	public void setJpName(String jpName) {
		this.jpName = jpName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Set<Vocabulary> getVocabularies() {
		return vocabularies;
	}

	public void setVocabularies(Set<Vocabulary> vocabularies) {
		this.vocabularies = vocabularies;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}
	
	public Date getModifiedDate() {
		return modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}

	public void setPartOfSpeechId(Short partOfSpeechId) {
		this.partOfSpeechId = partOfSpeechId;
	}
	
}
